package cn.morge.springbootquartz.controller;

import cn.morge.springbootquartz.entity.GoodInfoEntity;
import cn.morge.springbootquartz.service.GoodInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 麻贵海
 * 创建时间:2018/08/05 21:14
 * 项目名称:esim
 * @version 1.0
 * @since JDK 1.8
 * 类说明:
 */
@RestController
@RequestMapping(value = "/good")
public class GoodController {

    /**
     * 商品业务逻辑实现
     */
    @Autowired
    private GoodInfoService goodInfoService;

    /**
     * 添加商品
     *
     * @param good
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "save")
    public Long save(GoodInfoEntity good) throws Exception {
        return goodInfoService.save(good);
    }
}
